package com.example.node.controller;


import com.example.node.entity.BladeDept;
import com.example.node.service.BladeDeptService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yangss
 * @since 2023-11-29
 */
@RestController
@RequestMapping("/blade-dept")
public class BladeDeptController {
    @Resource
    private BladeDeptService bladeDeptService;

    //树型1
    @GetMapping("/tree/{tenanted}")
    public List<BladeDept> tree(@PathVariable("tenanted") String tenantId){
        List<BladeDept> tree = bladeDeptService.tree("000000");
        return tree;
    }
    //树型2 : 通过TreeUtil
    @GetMapping("/treeDept")
    public String treeDept(){
        String tree = bladeDeptService.deptTree();
        return tree;
    }
}

